package com.huawei.appgallery.agreementimpl.ui;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import androidx.annotation.Nullable;
import com.huawei.appgallery.agreement.api.ui.ITermsActivityProtocol;
import com.huawei.hmf.annotation.ActivityDefine;
import o.axa.c;
import o.axi;
import o.ayb.e;
import o.ayc;
import o.ayl;
import o.ayp;
import o.ays;
import o.ayw;
import o.cgv;

@ActivityDefine(alias = "AgreementSignActivity", protocol = ITermsActivityProtocol.class)
public class ShowTermsActivity extends AbsBaseProtocolActivity {
    private float ॱॱ;

    protected String ˊ() {
        return "ShowTermsActivity";
    }

    protected e ˎ() {
        return e.TERMS;
    }

    public void onCreate(@Nullable Bundle bundle) {
        axi.ˋ(0);
        ayw.ˋ((Activity) this, "LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES");
        ITermsActivityProtocol iTermsActivityProtocol = (ITermsActivityProtocol) this.ॱ.ॱ();
        if (iTermsActivityProtocol != null) {
            this.ˊ = iTermsActivityProtocol.isSignForUser();
            this.ˋ = iTermsActivityProtocol.getViewType();
            this.ˏ = iTermsActivityProtocol.getServiceType();
            this.ᐝ = iTermsActivityProtocol.getDialogId();
        }
        if (this.ˋ == 1) {
            this.ॱॱ = getResources().getConfiguration().fontScale;
            ayp.ˊ(getResources());
        }
        super.onCreate(bundle);
        ayl.ˋ(this);
        cgv.ˋ(this, c.ˎ, c.ˏ);
        if (this.ˋ != 1) {
            getWindow().getDecorView().setBackgroundColor(getResources().getColor(c.ˏ));
        }
        this.ˎ = ays.ˊ();
        this.ʽ = new ayc(this, iTermsActivityProtocol, this.ˎ);
        this.ʽ.ˎ(this);
    }

    public void onDestroy() {
        super.onDestroy();
        if (this.ˋ == 1) {
            Configuration configuration = getResources().getConfiguration();
            configuration.fontScale = this.ॱॱ;
            getResources().updateConfiguration(configuration, getResources().getDisplayMetrics());
        }
    }
}
